#include<stdio.h>
#include<string.h>
int main()
{
    FILE *fp=fopen("myfile","r");
    if(!fp)
    {
        perror("fopen fail");
    }
 const char *msg="hello wgx";
char buf[1024];



//  fwrite(msg,1,strlen(msg),fp);
while(1)
{
  size_t s=fread(buf,1,1,fp);
  if(s>0)
  {
    buf[s]=0;
    printf("%s\n",buf);
  }else 
  break;

}

    fclose(fp);
    return 0;
}